package com.example.lcode.backtrack;

/**
 * @version 1.0
 * @author: ChuJie_Lin
 * @since: 2021-12-11 15:40
 **/
public class question357 {

    public int countNumbersWithUniqueDigits(int n) {
        int res = 1;
        int product = 9;
        for (int i = 1; i < 10 && i <= n; i++) {
            res = product + res;
            product *= (10-i);
        }
        return res;
    }

    public static void main(String[] args) {
        question357 question357 = new question357();
        int i = question357.countNumbersWithUniqueDigits(3);
        System.out.println(i);
    }

}
